package com.hc.ssm;

import com.hc.config.RibbonConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients(basePackages = "com.hc.ssm.feign")
@RibbonClient(name = "app-haochenit-member",configuration = RibbonConfig.class)
public class DemoApplication {

    @Bean
    @LoadBalanced//注册中心则必须要开启负载均衡，此注解   //默认轮询机制
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

    public static void main(String[] args) {
        SpringApplication.run(com.hc.ssm.DemoApplication.class, args);
    }

}
